import request from '@/utils/request'
/**
 * 查询企业的部门列表
 * @returns
 */
export function getDepts() {
  return request({
    url: '/company/department'
  })
}
/**
 *  根据ID删除部门
 * @param {*} id
 * @returns
 */
export function delDept(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}
/**
 * 新增部门
 * @param {*} data
 * @returns
 */
export function addDept(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}
/** 根据ID查询部门详情
 *
 * @param {*} id
 * @returns
 */
export function getDeptDetail(id) {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}
/**
 * 根据ID修改部门详情
 * @param {*} id
 * @returns
 */
export function editDeptDetail(data) {
  return request({
    method: 'PUT',
    url: `/company/department/${data.id}`,
    data
  })
}
